<template>
  <div>
    项目名称:<input type="text" v-model="showData.Mname">
    <input type="button" value="查询" @click="show">
    <table>
      <tr>
        <td>项目名称</td>
        <td>年收益</td>
        <td>月收益</td>
        <td>最低金额</td>
        <td>理财人数</td>
        <td>风险等级</td>
        <td>操作</td>
      </tr>
      <tr v-for="item in list" :key="item.Mid">
        <td>{{ item.Mname }}</td>
        <td>{{ item.YearMoney }}</td>
        <td>{{ item.MonthMoney }}</td>
        <td>{{ item.SlotMoney }}</td>
        <td>{{ item.Mnum }}</td>
        <td>{{ item.Mtop}}</td>
        <td><input type="button" value="修改"></td>
      </tr>
    </table>
  </div>
</template>

<script setup lang="ts">


import { reactive,toRefs,onMounted } from 'vue';
import { useRouter } from 'vue-router';
let router = useRouter();

import axios from 'axios';

let data:any = reactive({
  list:[],
  showData:{
    Mname:'',
  }
})

let { list,showData } = toRefs(data);

onMounted(()=>{
  show();
})


const show=()=>{
axios({
  url:'http://localhost:50370/api/Money/GetShowMoney',
  method:'get',
  params:showData.value
}).then(res=>{
  list.value = res.data
console.log(res)
  }).catch(err=>{
console.log(err)
  })
}





</script>

<style scoped>

</style>